<?php if ( 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']) ) die ( 'Please do not load this page directly. Thanks.' ); ?>
<?php if ( !empty($post->post_password) ) : if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) : ?>
<p class="nopassword">This post is protected. Enter the password to comments.</p>
<?php return; endif; endif; ?>
<?php if ( $comments ) : ?>
<?php $ping_count = $comment_count = 0;
foreach ( $comments as $comment )
get_comment_type() == "comment" ? ++$comment_count : ++$ping_count;
?>
<?php if ( $comment_count ) : ?>
<h3><?php printf( $comment_count > 1 ? __( '<span>%d</span> Comments', 'wpm2' ) : __( '<span>One</span> Comment', 'wpm2' ), $comment_count ) ?></h3>
<?php foreach ( $comments as $comment ) : ?>
<?php if ( get_comment_type() == "comment" ) : ?>
<div id="comment-<?php comment_ID() ?>" class="comment">
<cite><?php comment_author_link() ?></cite> on <?php comment_date('F j, Y, g:i a'); ?>
<?php if ( $comment->comment_approved == '0' ) echo '<em>Your comment is awaiting moderation.</em>'; ?>
<?php comment_text(); ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if ( $ping_count ) : ?>
<h3><?php printf( $ping_count > 1 ? __( '<span>%d</span> Trackbacks', 'wpm2' ) : __( '<span>One</span> Trackback', 'wpm2' ), $ping_count ) ?></h3>
<?php foreach ( $comments as $comment ) : ?>
<?php if ( get_comment_type() != "comment" ) : ?>
<div id="comment-<?php comment_ID() ?>" class="comment">
<?php comment_author_link() ?> on <?php comment_date('F j, Y, g:i a'); ?>
<?php if ( $comment->comment_approved == '0' ) echo '<em>Your comment is awaiting moderation.</em>'; ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php if ( 'open' == $post->comment_status ) : ?>
<?php $req = get_option('require_name_email'); ?>
<h3>Post a Comment</h3>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p><?php printf( __( 'You must be <a href="%s" title="Log in">logged in</a> to post a comment.', 'wpm2' ), get_bloginfo('wpurl') . '/wp-login.php?redirect_to=' . get_permalink() ) ?></p>
<?php else : ?>
<form id="commentform" action="<?php bloginfo('wpurl') ?>/wp-comments-post.php" method="post">
<?php if ( $user_ID ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out</a>?</p>
<?php else : ?>
<p id="comment-notes"><?php _e( 'Your email is <em>never</em> shared.', 'wpm2' ) ?> <?php if ($req) _e( 'Required fields are marked <span class="required">*</span>', 'wpm2' ) ?></p>
<div><label for="author">Name<?php if ($req) _e( ' <span class="required">*</span>', 'wpm2' ) ?> </label><br /><input id="author" name="author" type="text" value="<?php echo $comment_author ?>" size="20" tabindex="1" /></div>
<div><label for="email">Email<?php if ($req) _e( ' <span class="required">*</span>', 'wpm2' ) ?> </label><br /><input id="email" name="email" type="text" value="<?php echo $comment_author_email ?>" size="20" tabindex="2" /></div>
<div><label for="url">Website</label><br /><input id="url" name="url" type="text" value="<?php echo $comment_author_url; ?>" size="20" tabindex="3" /></div>
<?php endif; ?>
<div><label for="comment">Comment</label><br /><textarea id="comment" name="comment" cols="30" rows="5" tabindex="4"></textarea></div>
<div><input id="submit" name="submit" class="button" type="submit" value="Post Comment" tabindex="5" /><input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></div>
<?php do_action( 'comment_form', $post->ID ); ?>
</form>
<?php endif; ?>
<?php endif; ?>